<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
        <style>
            .error {
                color: #ff0000;
            }
            .errorblock{
                color: #000;
                background-color: #ffEEEE;
                border: 3px solid #ff0000;
                padding:8px;
                margin:16px;
            }

        </style>
    </head>

    <body>
        <h2>Lending Books</h2>

        <form:form method="POST" commandName="lendingForm">

            <form:errors path="*" cssClass="errorblock" element="div"/>
            <table>
                <tr>
                    <td>UserId : </td>
                    <td><form:input path="userId" /></td>
                    <td><form:errors path="userId" cssClass="error" /></td>
                </tr>
                
                <tr>
                    <td>BookId : </td>
                    <td><form:input path="bookId" /></td>
                    <td><form:errors path="bookId" cssClass="error" /></td>
                </tr>
                
                <tr>
                    <td>Lending date : </td>
                    <td><form:input path="lendingDate" /></td>
                    <td><form:errors path="lendingDate" cssClass="error" /></td>
                </tr>
                
                <tr>
                    <td>Return Date : </td>
                    <td><form:input path="returnDate" /></td>
                    <td><form:errors path="returnDate" cssClass="error" /></td>
                </tr>
                
                <tr>
                    <td colspan="3"><input type="submit" /></td>
                </tr>
            </table>
        </form:form>
        <br>   <a href="<c:url value="home.htm"/>">Login</a>
        </br>
    </body>
</html>